//
//  BARecommendListVC.m
//  YunFu
//
//  Created by Bager on 2018/9/6.
//  Copyright © 2018年 yunfu. All rights reserved.
//

#import "BARecommendListVC.h"

#import "BAShopCell.h"

@interface BARecommendListVC ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation BARecommendListVC

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    [self createTable];
}

/**
 *  创建table
 */
- (void)createTable
{
    self.table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kPublicNavHeight) style:UITableViewStyleGrouped];
    _table.delegate = self;
    _table.dataSource = self;
    _table.showsVerticalScrollIndicator = NO;
    //    _table.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_table];
    
    UIView *noLine = [[UIView alloc] initWithFrame:CGRectZero];
    _table.tableFooterView = noLine;
}

#pragma mark - table协议

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 100;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 8;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.01;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    BAShopCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellIdentifiers"];
    if (!cell)
    {
        cell = [[BAShopCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellIdentifiers"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    
    return cell;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    return [UIView new];
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    return [UIView new];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (self.callBack)
    {
        self.callBack(scrollView);
    }
}


@end
